<template>
  <!--韶华追忆-->
  <div class="warp">
    <div class="main_l">
      <div class="news_works">
        <!-- 返回首页 -->
        <backIndex :title="title"/>
        <div>
          <p class="title">{{detail.title}}</p>
          <div class="time">
            <span>时间：{{parseTime(detail.create_time)}}</span>
          </div>
          <!-- 内容 -->
          <div v-html="detail.content">

          </div>
        </div>
      </div>
    </div>
    <!-- 主要右边 -->
    <mainR />
  </div>
</template>

<script>
import backIndex from "@/components/backIndex";
import mainR from "@/components/mainR";
import cloud from '@/api/cloud'

export default {
  components: { mainR , backIndex },
  data() {
    return {
      title:'',
      detail:{
        title:'',
        content:'',
        create_time:''
      }
      
    };
  },
  mounted() {
    console.log(this.$route.query)
    this.title = this.$route.query.title
    this.getdDetail()
  },
  computed: {},
  methods: {
    // 详情
    async getdDetail(){
      const table = this.$route.query.table
      const data={
        _id:this.$route.query.id
      }
      const res = await cloud.invoke(`${table}_detail`,data)
      if(res.success){
        this.detail = res.data
      }
    },
  }
};
</script>
<style scoped>
.title{
  text-align: center;
  font-size: 16px;
  margin: 10px;
}
.time{
  text-align: right;
  color: #999;
  font-size: 12px;
}
</style>
